<template>
  <div>
    <div>账号切换</div>
    <button @click="admin()" type="default" size="mini">admin</button>
    <button @click="zhangsan()" type="default" size="mini">张三经理</button>
    <button @click="lisi()" type="default" size="mini">李四总经理</button>
    <div>当前token：{{ token }}</div>
  </div>
</template>

<script>
export default {
  name: "Test",

  data() {
    return {
      token: ''
    };
  },

  created(){
    this.token = window.localStorage.getItem('token')
  },

  methods: {
    admin() {
      window.localStorage.setItem('token', '');
      let token = 'eyJhbGciOiJIUzUxMiIsInppcCI6IkdaSVAifQ.H4sIAAAAAAAAAKtWKi5NUrJSKi1OLVLSUUqtKFCyMjSzMDcyMzUyN9MBi3umAMUgzLzE3FSg6sSU3Mw8pVoAK6QeGz0AAAA.0jW7SLD_-Xd80sE-DWvzlJq2rAhxRQF0VbVM2HAVF3g0aYkk_3ywIspZgNexsjCmZqmikvjVO86nxfgPaC5V7g'
      window.localStorage.setItem('token', token);
      this.token = window.localStorage.getItem('token')
    },

    zhangsan() {
      window.localStorage.setItem('token', '');
      let token = 'eyJhbGciOiJIUzUxMiIsInppcCI6IkdaSVAifQ.H4sIAAAAAAAAAKtWKi5NUrJSKi1OLVLSUUqtKFCyMjSzMDcyMzUzNdEBi3umKFkZQZh5ibmpQNVVGYl56cWJeUq1AH4dIyBAAAAA.dw2DYTTCrC4awomCnc--N9M-eLPp47UKJO8AmN5JEIeAHy4FI1WYLcEv_NpH2LTntSybMm971vXc4_e5wyc6AQ'
      window.localStorage.setItem('token', token);
      this.token = window.localStorage.getItem('token')
    },

    lisi() {
      window.localStorage.setItem('token', '');
      let token = 'eyJhbGciOiJIUzUxMiIsInppcCI6IkdaSVAifQ.H4sIAAAAAAAAAKtWKi5NUrJSKi1OLVLSUUqtKFCyMjSzMDcyMzU3stABi3umKFkZQ5h5ibmpQNU5mcWZSrUA_BVytTwAAAA.29yHTFtxHYamiUBX_HRMNP0aPSh7DfQHRXOEb8YliwT_dto741TMIfUf_bR3H6YcqgUPZaAwwK8QklLk-iuvuw'
      window.localStorage.setItem('token', token);
      this.token = window.localStorage.getItem('token')
    }
  }
}
</script>
